﻿/*
using System;
using System.Collections.Generic;
using System.Linq;
using Daroctrius.WebTV.Database.Model;
using HtmlAgilityPack;

namespace Daroctrius.WebTV.Handlers
{
    public class TeleQuebec : Base
    {
        public List<Content> GetCategories()
        {
            HtmlDocument doc;
            Content category, show;
            int getEpisodesMethodId, getShowMethodId;

            doc = LoadHtmlDocument(Content.Method.Handler.SiteUrl);

            getEpisodesMethodId = this.GetMethodID("GetEpisodes");
            getShowMethodId = this.GetMethodID("GetShows");

            foreach (HtmlNode p in doc.DocumentNode.SelectNodes("html/body/div[@id=\"pageContentDiv\"]/div[@id=\"pageContent\"]/div[@id=\"leftColDiv\"]/p[contains(@class, \"navSectionTitle\")]"))
            {
                if (!p.Attributes["class"].Value.Contains("navTitleNavigation"))
                {
                    category = new Content()
                    {
                        ContentID = Guid.NewGuid(),
                        ParentID = Content.ContentID,
                        MethodID = getShowMethodId,
                        Name = p.InnerText
                    };

                    Database.Contents.Add(category);

                    foreach (HtmlNode li in p.NextSibling.NextSibling.SelectNodes("li"))
                    {
                        show = new Content()
                        {
                            ContentID = Guid.NewGuid(),
                            MethodID = getEpisodesMethodId,
                            Name = li.InnerText,
                            ContentUrl = li.SelectSingleNode("a").Attributes["href"].Value
                        };

                        category.Contents1.Add(show);
                    }
                }
            }

            
            Database.SaveChanges();

            return Database.Contents.Where(c => c.MethodID == getShowMethodId).ToList();
        }

    }
}*/